package cn.com.api.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiU_advert;
import cn.com.api.entity.ApiU_advert_resource;
import cn.com.api.mapper.base.U_advertMapperBase;
import cn.com.util.PageInfo;

//DAO
public interface ApiU_advertMapper extends U_advertMapperBase {

	// 根据广告位获取广告列表
	public List<ApiU_advert> findU_advertByPostionIDListPage(@Param("position_id") Integer position_id,
			@Param("page") PageInfo pageInfo);

	public List<ApiU_advert> findBonus_AdvertByMapListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo pageInfo);
	
	//获取已领取过的红包广告列表
	public List<ApiU_advert> findMyBonus_AdvertByMapListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo pageInfo);

	// 标题模糊查询广告
	public List<ApiU_advert> findBonusU_advertByWordsListPage(@Param("keyword") String keyword,
			@Param("user_id") String user_id, @Param("page") PageInfo pageInfo);

	// 喊红包广告
	public List<ApiU_advert> findCallBonusU_advertListPage(@Param("keyword") String keyword,
			@Param("user_id") String user_id, @Param("type") Integer type, @Param("page") PageInfo pageInfo);

	//
	public ApiU_advert findBonusAdvertByBonusID(@Param("bonus_id") String bonus_id);

	// 新增对象后返回记录ID
	public int U_advertInsertion(ApiU_advert u_advert);

	// 获取收藏的广告列表
	public List<ApiU_advert> findAdvertListByFavoriteTypeListPage(@Param("user_id") String user_id,
			@Param("type") Integer type, @Param("page") PageInfo page);

	// 查询广告
	public List<Map<String, String>> findU_adverts_infos(@Param("map") Map<String, Object> map);

	// 根据User_id获取喊红包广告
	public List<ApiU_advert> findCallBonusU_advertByUserIDListPage(@Param("user_id") String user_id,
			@Param("page") PageInfo page);

	public ApiU_advert findAdvertsInfoByMap(@Param("map") Map<String, Object> map);

	public List<ApiU_advert> findAdvertInfos(@Param("map") Map<String, Object> map);
	
	public List<ApiU_advert> findInterestBonus_AdvertByMapListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo pageInfo);
	//获取我的嗨红包列表
	public List<ApiU_advert> getMyHaiBonusListPage(@Param("user_id") String user_id, @Param("page") PageInfo page);
}
